#!/usr/bin/env python
# -*- coding:utf-8 -*-
#########命令#########

import os

#获取cpu_load值
def get_load_avg():
    try:
        with open('/proc/loadavg','rb') as f:
            load_1=float(f.readline().split()[0])
            return load_1
    except:
        return None

#获取进程总数
def get_pro_num():
    try:
        cmd="ps aux |wc -l|tail -1"
        proc_num=os.popen(cmd).read().strip()
        return proc_num
    except :
        return None

# if __name__ == '__main__':
#     print get_pro_num()
